
<%@ page import="ar.org.sstuyv.Expediente" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'expediente.label', default: 'Expediente')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-expediente" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
<%--				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>--%>

			</ul>
			
<%--		Formulario de búsqueda	--%>
			<div>
				<g:form name="myForm" url="[controller:'busquedaExpediente',action:'list']">
					<label>Numero: </label>
		            <g:textField name="inputBusqueda" value="${inputBusqueda}"/>
		            <label>Partido: </label>
					<g:select id="partido" 	name="partido.id" from="${ar.org.sstuyv.Partido.list()}" 
											optionKey="id" 
											value="${expedienteInstance?.partido?.id}" class="many-to-one"
											noSelection="['':'']"/>
											
					<label>Tipo de Expediente</label>											
					<g:select id="tipoExpediente" 	name="tipoExpediente.id" 
											from="${ar.org.sstuyv.TipoExpediente.list()}" 
											optionKey="id" 
											value="${tipoexpedienteInstance?.id}" 
											class="many-to-one"
											noSelection="['':'']"/>											
		            <g:submitButton name="list" class="list" value="Buscar" />
	            </g:form>
            </div>
<%--        Fin formulario de búsqueda    --%>
            
		</div>
		<div id="list-expediente" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			
            
			<table>
				<thead>
					<tr>
					
						<g:sortableColumn property="numero" title="${message(code: 'expediente.numero.label', default: 'Numero')}" />
					
						<g:sortableColumn property="alcance" title="${message(code: 'expediente.alcance.label', default: 'Alcance')}" />
					
						<g:sortableColumn property="cuerpo" title="${message(code: 'expediente.cuerpo.label', default: 'Cuerpo')}" />
					
						<g:sortableColumn property="extracto" title="${message(code: 'expediente.extracto.label', default: 'Extracto')}" />
					
						<g:sortableColumn property="fechaInicio" title="${message(code: 'expediente.fechaInicio.label', default: 'Fecha Inicio')}" />
					
						<g:sortableColumn property="tipoExpediente" title="${message(code: 'expediente.tipoExpediente.label', default: 'Tipo Expediente')}" />
					
					</tr>
				</thead>
				<tbody>
				<g:each in="${expedienteInstanceList}" status="i" var="expedienteInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="show" id="${expedienteInstance.id}">${fieldValue(bean: expedienteInstance, field: "numero")}</g:link></td>
					
						<td>${fieldValue(bean: expedienteInstance, field: "alcance")}</td>
					
						<td>${fieldValue(bean: expedienteInstance, field: "cuerpo")}</td>
					
						<td>${fieldValue(bean: expedienteInstance, field: "extracto")}</td>
					
						<td><g:formatDate date="${expedienteInstance.fechaInicio}" /></td>
					
						<td>${fieldValue(bean: expedienteInstance, field: "tipoExpediente")}</td>
					
					</tr>
				</g:each>
				</tbody>
			</table>
			<div class="pagination">
				<g:paginate total="${expedienteInstanceTotal}" />
			</div>
		</div>
	</body>
</html>
